home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 56118 / 56118.xpi / chrome / content / ffbccthis / win / ffbccthisOverlay.xul
Extensible Markup Language  |  2010-02-03  |  2KB  |  52 lines

  1. <?xml version="1.0"?>
  2. <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
  3. <?xml-stylesheet href="chrome://ffbccthis/skin/ffbccthisOverlay.css" type="text/css"?>
  4.  
  5. <overlay id="bccthis-mozilla-extension" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  6.  
  7.   <!-- our mac clipping javascript code -->
  8.   <script type="application/x-javascript" src="chrome://ffbccthis/content/bccthis.js"/>
  9.  
  10.   <!-- common function to put the button in the toolbar the first go-round -->
  11.   <script type="application/x-javascript" src="chrome://ffbccthis-common/content/toolbar-button-init.js"/>
  12.  
  13. <script type="application/x-javascript">
  14. <![CDATA[
  15.     function ClickBccthis(event) {
  16.         if (event.button == 0) {
  17.             var d=content.document;
  18.             var w=window;
  19.             var f='http://bccth.is/bookmarklet/index.php?';
  20.             var l=d.location;
  21.             var e=encodeURIComponent;
  22.             var p='address='+e(l.href)+'&title='+e(d.title);
  23.             var u=f+p;
  24.  
  25.             var br = document.getElementById("content");
  26.             var wnd = null;
  27.             if (br == null || !br.selectedTab)
  28.                 wnd = document.commandDispatcher.focusedWindow;
  29.             else
  30.                 wnd = br.getBrowserForTab(br.selectedTab).docShell
  31.                                    .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
  32.                                    .getInterface(Components.interfaces.nsIDOMWindow);
  33.  
  34.             var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
  35.                                .getService(Components.interfaces.nsIWindowWatcher);
  36.             var win = ww.openWindow(wnd, u, null, "scrollbars=no,toolbar=no,location=no,resizable=no,status=no,width=590,height=610,chrome=yes,centerscreen,dialog=yes", null);
  37.         }
  38.         return true;
  39.     }
  40. ]]>
  41. </script>
  42.  
  43.   <!-- our Firefox toolbar button -->
  44.   <toolbarpalette id="BrowserToolbarPalette">
  45.     <toolbarbutton id="bccwebclipper3-button" label="Bccth.is"
  46.       class="bccwebclipper3-button toolbarbutton-1"
  47.       tooltiptext="Tweet this page with Bccthis"
  48.       onclick="return ClickBccthis(event);" />
  49.   </toolbarpalette>
  50.  
  51. </overlay>
  52.